/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.b1;

import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class B5_FiboThuN {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Nhập n = ");
        int n = sc.nextInt();
        System.out.println("Số Fibonaxi thứ "+n+" là: "+fibo(n));
    }
    static int fibo(int n){
        int i = 0, j = 1, t, d = 2;
        while(d<=n){
            t = i + j;
            i = j;
            j = t;
            d++;
        }
        return j;
    }
}
